# Creating a new Post

Posts to the Activity Feed of a workspace (project).
**Bulk Create**
This endpoint supports bulk creating up to 100 objects. In the request body, set the top-level key to its plural form and place the objects in an array. Example:

```
{
  "posts": [
    {
      "workspace_id": 123,
      "message": "Post"
    },
    {
      "workspace_id": 456,
      "message": "Post"
    }
  ]
}
```
This endpoint returns structured Post objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the `results` array
and will be indexed by ID in the `posts` top-level JSON key.
Please see our [Response Format](#section/Response-Format) section for more information.

Endpoint: POST /posts
Version: 1.0.0

## Query parameters:

  - `include` (string)
    Any of the below associations can be included in your request by providing the `include` param, e.g. `include=association1,association2`.
- `attachments` (Attachments::PostAttachment) - Any attachments associated to the post.
- `external_references` (ExternalReference) - Includes references to external integrations for this object.
- `google_documents` (GoogleDocument) - The post's Google document objects, available in `google_document_ids`; returned in the `google_documents` top-level key.
- `newest_reply` (Post) - The most recent reply to the post.
- `newest_reply_user` (User) - The user who made the most recent reply to the post.
- `recipients` (User) - On private posts, the `recipient_ids` array contains the IDs of recipients, returned in the `users` top-level key.
- `replies` (Post) - Replies made to this post, returned in the `posts` top-level key. Posts will contain a `reply_ids` array.
- `story` (Story) - The task (if any) to which the post is linked.
- `subject` (polymorphic) - When you include this association, posts that are replies will have a `subject_id` key. This references
their parent post in the `posts` top-level key.
- `user` (User) - The user who created the post.
- `workspace` (Workspace) - The project to which this post belongs.

## Request fields (application/json):

  - `post` (object)

  - `post.workspace_id` (integer, required)
    The ID of the project in which the post will be created.

  - `post.message` (string, required)
    The content created in the new post.

  - `post.subject_id` (integer)
    The ID of the item to which the new post is replying (only `required` for replies).

  - `post.subject_type` (string)
    The type of item to which the new post is replying (only `required` for replies). Accepted values are `Post`.

  - `post.story_id` (integer)
    The ID of the task to which the new post should be linked.

  - `post.recipient_ids` (array)
    An array of User IDs for which the post is visible. These users must be participating in the target
project. Including this parameter will make the post private.

  - `post.attachment_ids` (array)
    An array of PostAttachment IDs to be associated with the post. Create PostAttachments using
the attachments endpoint.

  - `post.google_documents` (array)
    An array of Google document to be associated with the post.

  - `post.google_documents.resource_id` (string)
    A unique identifier for the Google document.

  - `post.google_documents.access` (string)
    Allowed access to the Google document.

  - `post.backdated_to` (string)
    Backdates the post creation date on imports. Defaults to *Now*. The datetime must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

## Response 200 fields (application/json):

  - `count` (integer)

  - `meta` (object)

  - `meta.count` (integer)

  - `meta.page_count` (integer)

  - `meta.page_number` (integer)

  - `meta.page_size` (integer)

  - `results` (array)

  - `results.key` (string)

  - `results.id` (string)

## Response 400 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 401 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 403 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 404 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 422 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 503 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

